package io.gitee.twoke.generator.engine.impl.cmd;

import io.gitee.twoke.generator.engine.impl.cfg.GenerateEngineConfigurationImpl;
import io.gitee.twoke.generator.engine.impl.generate.processor.GenerateExecutor;
import io.gitee.twoke.generator.engine.impl.generate.processor.GenerateExecutorImpl;
import io.gitee.twoke.generator.engine.impl.interceptor.Command;
import io.gitee.twoke.generator.engine.impl.interceptor.CommandContext;

public class GenerateCodeOfTableConfigCmd implements Command<Void> {

    private String tableId;
    private GenerateEngineConfigurationImpl generateEngineConfiguration;
    private GenerateExecutor generateProcessorExecutor;
    public GenerateCodeOfTableConfigCmd(String id ,GenerateEngineConfigurationImpl generateEngineConfiguration) {
        this.tableId = id;
        this.generateEngineConfiguration = generateEngineConfiguration;
        this.generateProcessorExecutor = new GenerateExecutorImpl(generateEngineConfiguration);
    }

    @Override
    public Void execute(CommandContext commandContext) {
        this.generateProcessorExecutor.execute(this.tableId);
        return null;
    }

}
